//登录用户信息
var LOGINUSERUSERNAME = "";
var LOGINUSERTRUENAME = "";
var LOGINUSERNICKNAME = "";
var LOGINUSERLASTTIME= "";
welcomes = function() {
	return {
		panel: function() {
			var now = new Date(), hour = now.getHours(), whou = "";
	        if (hour > 4 && hour < 6) { $("#hello").html("凌晨好！"); }
	        else if (hour < 9) { whou = "早上好！"; }
	        else if (hour < 12) { whou = "上午好！"; }
	        else if (hour < 14) { whou = "中午好！"; }
	        else if (hour < 17) { whou = "下午好！"; }
	        else if (hour < 19) { whou = "傍晚好！"; }
	        else if (hour < 22) { whou = "晚上好！"; }
	        else { whou = "夜深了，注意休息！"; }
	        
	        //获取登录用户信息
//	    	var res = RequestByUrl('../admin/index.jspx?userinfo', {});
//	    	LOGINUSERUSERNAME = res.username;
//	    	LOGINUSERTRUENAME = res.truename;
//	    	LOGINUSERNICKNAME = res.nickName;
//	    	LOGINUSERLASTTIME = res.lastTime;
			var welPanel = new Panel({
				title: LOGINUSERNICKNAME + ',' + whou + '欢迎使用Online Judge管理中心！',
				iconCls: 'icon-user',
				height: 60,
				style: 'margin: 10px',
				layout: 'fit',
				items: [{
	                xtype: 'fieldcontainer',
	                layout: 'hbox',
	                defaults: {
	                    hideLabel: true
	                },
	                items: [{
	                	xtype: 'label',
	                	flex: 1,
	                	style: 'margin-top: 4px; margin-left: 4px;',
	                	text: '上次登录时间：' + LOGINUSERLASTTIME
	                }, {
	                	xtype: 'button',
	                	text: '个人信息',
	                	style: 'margin-right: 4px'
	                }, {
	                	xtype: 'button',
	                	text: '修改信息',
	                	style: 'margin-right: 4px'
	                		
	                }]
	            }]
			});
			
			var fastPanel = new Panel({
				title: '系统使用说明',
				iconCls: 'icon-state',
				height: 150,
				style: 'margin: 10px'
			});
			
			var panel = new Panel({
				title: '我的主页',
				closable : false,
				layout: 'anchor',
				defaults: {
					anchor: '100%'
				},
//				bodyPadding: 15,
				autoScroll: true,
				items: [welPanel, fastPanel]
			});
			
			return panel;
		}
	};
}();